package com.heihx.api.client;

import com.heihx.entity.ShoppingCart;
import com.heihx.result.Result;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient("cart-service")
public interface CartClient {
    /**
     * 查看购物车
     * @return
     */
    @GetMapping("/user/shoppingCart/list")
    @Operation(summary = "查看购物车")
    Result<List<ShoppingCart>> list();

    /**
     * 清空购物车
     * @return
     */
    @DeleteMapping("/user/shoppingCart/clean")
    @Operation(summary = "清空购物车")
    Result clean();

    /**
     * 批量添加购物车
     * @param shoppingCartList
     * @return
     */
    @PostMapping("/user/shoppingCart/addBatch")
    @Operation(summary = "批量添加购物车")
    Result addBatch(@RequestBody List<ShoppingCart> shoppingCartList);

}
